<?php

namespace frontend\modules\touch\controllers;

use yii\web\Controller;
use common\components\MobileDetect;

/**
 * Default controller for the `touch` module
 */
class DefaultController extends Controller
{
    /**
     * Renders the index view for the module
     * @return string
     */
    public $layout = 'main';

    public function actionIndex()
    {
        $detect = new MobileDetect();
        if(!$detect->isMobile() && !$detect->isTablet()){
            return $this->redirect('/home/default/index');
        }

//        $this->layout = false;
        return $this->render('index');
    }
}
